<?php
/**
 * Created by PhpStorm.
 * User: xiao
 * Date: 2018/9/7
 * Time: 16:15
 */

namespace app\index\controller;


use app\common\utils\JUtil;
use app\common\utils\NetUtil;
use think\Request;

class Home
{
    public function getData(Request $request)
    {

        $page = $request->get('page', 1);
        $pageSize = $request->get('pageSize', 10);

        $sendData = array(

            'page' => $page,
            'pageSize' => $pageSize,

        );

        $url = 'http://qipa.xmuheart.com/Goods/getData';
        $result = NetUtil::GET($url, $sendData);
        $result = json_decode($result, true);

        $data['page'] = $page;
        $data['pageSize'] = $pageSize;
        $data['totalPage'] = $result['pagecount'];
        $data['total'] = $result['total'];
        $data['list'] = $result['rows'];
        return json(JUtil::S('', $data));
    }


}